/*
 * @Author: yuki
 * @Date: 2025-11-06 15:28:56
 * @LastEditTime: 2025-11-06 16:10:56
 * @Description: 用户模块控制器
 */
import { Controller, Get, Query } from '@nestjs/common';

import { GetUserInfoDto } from './dto/user.dto';
import { UserService } from './user.service';

@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}
  @Get('getInfo')
  getUserInfo(@Query() data: GetUserInfoDto) {
    if (data.id) {
      return this.userService.getUserInfoById(data.id);
    }
    if (data.username) {
      return this.userService.getUserInfoByUsername(data.username);
    }
  }
}
